﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace POSGui.Classes.BusinessLogic
{
    public class ClientManager
    {
        #region Properties
        public ERPSIA.AuxiliarAccount Branch { get; set; }
        public int DefaultStore {get; set;}

        #endregion

        #region Singleton
        private static ClientManager _instance;

        private ClientManager()
        {
            DefaultStore = Constants.INVALID_ID;
        }

        public static ClientManager GetInstance()
        {
            if (_instance == null)
            {
                _instance = new ClientManager();
            }
            return _instance;
        }
        #endregion

        #region Public Methods

        public WebServiceAgent LogIn(string username, string password, string branch)
        {
            WebServiceAgent webServiceConnection = new WebServiceAgent();
            Branch = webServiceConnection.LogIn(username, password, branch);
            return Branch != null? webServiceConnection:null;
        }

        #endregion
    }
}